﻿using System;
using ZL.Web.Utility;
using ZL.Web.Utility.Cache;
using ZLWeb.WebApiEntityBase.RedisEntity;
using ZLWeb.WebApiRepository.Base;

namespace ZLWeb.WebApiInfrastructure.Filter
{
    public class AccidHelper
    {
        public static AccidModel GetAccid(string PassportType, string Passport)
        {
            IAccidFinder routeFinder;
            routeFinder = new RedisAccidFinder(PassportType, Passport);
            AccidModel Accid = routeFinder.GetAccid();
            return Accid;
            //if (accid == 0)
            //{
            //    if (SqlConnectionLoader.GetConnectionsCount() == 1)
            //    {
            //        routeFinder = new DbAccidFinder(PassportType, Passport);
            //        accid = routeFinder.GetAccid();
            //    }
            //}

        }
    }
}
